const mongoose = require('mongoose')
const MongoClient = require('../db')

// 创建schema
const tranportInfoSchema = new mongoose.Schema({
    userName: { type: String, required: true }, //货主姓名
    transportName: { type: String, required: true }, //货物名称
    transporImage: { type: Array }, //货物描述文件
    date: { type: Date, default: Date.now }, //货物的创建时间
    idNumber: { type: String, required: true }, //货主身份证号，关联货主信息使用 
    transportDescribe: { type: String }, //货物描述
    transportWeight: { type: String, required: true }, //货物重量
    transportPlace: { type: String, required: true }, //发货地
})

// 定义数据表模型
const tranportInfoLists = MongoClient.model('tranportInfos', tranportInfoSchema)
module.exports = {
    tranportInfoLists
}